using System.IO;

namespace ImageUploaderComponent.Extensions{
    public static class StreamExtensions{
        public static byte[] ToArray(this Stream stream) {

            var length = (int)stream.Length;
            var buffer = new byte[length];
            stream.Read(buffer, 0, length);
            return buffer;
        }
    }
}